# create release for @ngx-dummy/accordion-simple lib
name: release

on:
  push:
    tags:
      - 'v*' # Push events to matching v*, i.e. v1.0, v2.0.1

jobs:
  build:
    if: startsWith(github.repository_owner, 'ngx')
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        
      - name: Create Release
        id: create_release
        uses: softprops/action-gh-release@v0.1.14
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions
          RELEASE_VERSION: "${{  toJSON(github.ref) }} | cut -d / -f 3"
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          body: |
            Changes in this Release
            - Extended library functionality
            - Version bump to ${{ env.RELEASE_VERSION }}
          draft: false
          prerelease: false